﻿@model ContosoUniversity.Models.Student
@{
    ViewBag.Title = "Details";
}
<h2>
    Details</h2>
<fieldset>
    <legend>Student</legend>
    <div class="display-label">
        LastName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.LastName)
    </div>
    <div class="display-label">
        FirstMidName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FirstMidName)
    </div>
    <div class="display-label">
        EnrollmentDate</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.EnrollmentDate)
    </div>
    <div class="display-label">
        @Html.LabelFor(model => model.Enrollments)
    </div>
    <div class="display-field">
        <table>
            <tr>
                <th>
                    Course Title
                </th>
                <th>
                    Grade
                </th>
            </tr>
            @foreach (var item in Model.Enrollments)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Course.Title)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Grade)
                    </td>
                </tr>
            }
        </table>
    </div>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.StudentID }) |
    @Html.ActionLink("Delete", "Delete", new { id=Model.CourseID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
